﻿// web service to be used with a phone application to determine colour type and advise on the best colours to wear based on a user hair colour, eye colour and skin tone

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using System.ComponentModel.DataAnnotations;

namespace ColourAppWebService
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IColourTypeService" in both code and config file together.
    
    // enums for the characteristics
    public enum DominantCharacteristic { Deep, Light, Bright, Soft, Warm, Cool }
    public enum SecondaryCharacteristic { Cool, Warm, Deep, Light }

    // enums for the colour type options. Using System.ComponentModel.Description to allow for spacing between the words as ToString() doesn't add in a space
    public enum ColourTypeName 
    { 
        [System.ComponentModel.Description("Deep Winter")]
        DeepWinter,
         [System.ComponentModel.Description("Deep Autumn")] 
        DeepAutumn,
        [System.ComponentModel.Description("Light Spring")]
        LightSpring,
         [System.ComponentModel.Description("Light Summer")]
        LightSummer,
         [System.ComponentModel.Description("Bright Winter")]
        BrightWinter,
         [System.ComponentModel.Description("Bright Spring")] 
        BrightSpring,
         [System.ComponentModel.Description("Soft Autumn")]
        SoftAutumn,
         [System.ComponentModel.Description("Soft Summer")]
        SoftSummer,
        [System.ComponentModel.Description("Warm Spring")]
        WarmSpring,
         [System.ComponentModel.Description("Warm Autumn")] 
        WarmAutumn,
         [System.ComponentModel.Description("Cool Summer")]
        CoolSummer,
        [System.ComponentModel.Description("Cool Winter")]
        CoolWinter,
    }

    [MetadataType(typeof(ColourTypeInfo))]
    public partial class ColourType
    {
        // ...
    }

    public class ColourTypeInfo
    {
        [DataMember]
        public string ColourType_id;

        [DataMember]
        public string ColourType_name;

        [DataMember]
        public string ColourType_description;
    }
   
    [ServiceContract(Namespace= "http://colouradvisorapp.com")]
    public interface IColourTypeService
    {
        [OperationContract]
        // method to determine Dominant Characteristic based on user selection passed from phone to web service 
        DominantCharacteristic DetermineDominantCharacteristic(int hairIndex, int eyeIndex, int skinIndex);

        [OperationContract]
        // method to determine the colour type based on the Dominant Characteristic plus the Secondary Characteristic    
        ColourTypeName DiscoverColourType(DominantCharacteristic dominantCharacteristic, SecondaryCharacteristic secondaryCharacteristic);      

        [OperationContract]
        // method to return a colour type object for a specified colour type. Object returned contains id, name and description. 
        // Description will be displayed on phone client and id used for operation to get fashion trends description 
        ColourType DisplayColourTypeDescription(ColourTypeName colourType); 

        [OperationContract]
        // method to get fashion trends description for a specified colour type 
        String DisplayFashionTrendsDescription(String colourType_id, String season_name, Int16 season_year);
    }   
}
